<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta name="description" content="">
  <meta name="author" content="">
  <title>部门管理</title>
  <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
  <link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
  <link href="vendor/datatables/dataTables.bootstrap4.css" rel="stylesheet">
  <link href="css/sb-admin.css" rel="stylesheet">
</head>

<body class="fixed-nav sticky-footer bg-dark" id="page-top">
  <jsp:include page="header.jsp"/>
 <div class="content-wrapper">      
      <!-- Example DataTables Card-->
      <div class="card mb-3">
        <div class="card-body">
          <div class="table-responsive">
             <table width="100%" border="0" cellpadding="0" cellspacing="0">
              <tr>
              <td>[部门管理]</td>
              <td align="right">
             <input type="button" value="增加" class="nav-link-text"
              onclick="window.location.href='${pageContext.request.contextPath}/department_saveUI.action'">
             </td>
              </tr>
              </table>
            <table class="table table-bordered" width="100%" cellspacing="0">
             <thead>
                <tr>
                  <th>部门名称</th>
                  <th>编辑</th>
                  <th>删除</th>
                </tr>
              </thead>
              <tfoot>
                <tr>
                  <th>部门名称</th>
                  <th>编辑</th>
                  <th>删除</th>
                </tr>
              </tfoot>
              <tbody>
              <s:iterator value="list" var="d">
                <tr>
                  <td align="center"><s:property value="#d.dname"/></td>
                  <td align="center"><a href="${pageContext.request.contextPath}/department_edit.action?did=<s:property value="#d.did"/>">
                  <img src="images/editor.png" width="30" height="30"></a></td>
                  <td align="center"><a href="${pageContext.request.contextPath}/department_delete.action?did=<s:property value="#d.did"/>">
                  <img src="images/delete.png" width="30" height="30"  onclick="return confirm('确定要删除吗？')"></a></td>
                </tr>
                </s:iterator>
              </tbody>
            </table>
          </div>
        </div>
    <table border="0" cellpadding="0" cellspacing="0">
    <tr>
    <td>
    <span>第<s:property value="currPage"/>/<s:property value="totalPage"/>页</span>&nbsp;&nbsp;
    <span>总记录数:<s:property value="totalCount"/>&nbsp;&nbsp;每页显示：<s:property value="pageSize"/>条</span>
    <s:if test="currPage!=1">
    <a href="${pageContext.request.contextPath}/department_findAll.action?currPage=1">[首页]</a>&nbsp;&nbsp;
    <a href="${pageContext.request.contextPath}/department_findAll.action?currPage=<s:property value="currPage-1"/>">[上一页]</a>&nbsp;&nbsp;
    </s:if>
    <s:if test="currPage!=totalPage">
    <a href="${pageContext.request.contextPath}/department_findAll.action?currPage=<s:property value="currPage+1"/>">[下一页]</a>&nbsp;&nbsp;
    <a href="${pageContext.request.contextPath}/department_findAll.action?currPage=<s:property value="totalPage"/>">[尾页]</a>&nbsp;&nbsp;
    </s:if>
    </td>
    </tr>
    </table> 
      </div>
    </div>
    <jsp:include page="foot.jsp"/>
</body>
</html>